<!doctype html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>jQuery UI 自动完成（Autocomplete） - 默认功能</title>
    <link rel="stylesheet" href="js/plugins/ui/jquery-ui.min.css">
    <script src="/js/jquery/jquery.min.js"></script>
    <script src="js/plugins/ui/jquery-ui.min.js"></script>
    <link rel="stylesheet" href="js/plugins/ui/jquery-ui.theme.min.css">
    <script>
        $(function() {
            //注意发送ajax请求需要时间(滞后性)
            $.get("/strategies/search",function (data) {
                console.log(data);
                var availableTags=data
                $( "#tags" ).autocomplete({
                    source: availableTags
                });

            })


            /*var availableTags = [
                "ActionScript",
                "AppleScript",
                "Asp",
                "BASIC",
                "C",
                "C++",
                "Clojure",
                "COBOL",
                "ColdFusion",
                "Erlang",
                "Fortran",
                "Groovy",
                "中国",
                "Haskell",
                "Java",
                "JavaScript",
                "Lisp",
                "Perl",
                "PHP",
                "Python",
                "Ruby",
                "Scala",
                "Scheme"
            ];
            $( "#tags" ).autocomplete({
                source: availableTags
            });*/

        });
    </script>



</head>
<body>

<div class="ui-widget">
    <label for="tags">标签：</label>
    <input id="tags">
</div>


</body>
</html>